package com.jysz.certificate.persistence.dao.pm;

import java.util.List;

import org.hibernate.Criteria;
import org.hibernate.criterion.Restrictions;
import org.springframework.stereotype.Repository;

import com.jysz.certificate.persistence.dao.AbstractBaseDao;
import com.jysz.certificate.persistence.enums.pm.PmUserStype;
import com.jysz.certificate.persistence.model.pm.PmUser;

@Repository
public class PmUserDao extends AbstractBaseDao<PmUser, Long> {

	@SuppressWarnings("unchecked")
	public List<PmUser> findAllByMonth(String monthDate) {
		Criteria criteria = this.createCriteria();
		criteria.add(Restrictions.eq("deliceryMM", monthDate));
		criteria.add(Restrictions.eq("state", PmUserStype.SUBMITED));
		return criteria.list();
	}

}
